public class JIanhang {
    public static void main(String[] args) {
        int x = getLength("aBcbA",2);
        System.out.println("res = " + x);
//        ListNode head = new ListNode(2);
//        head.next = new ListNode(3);
//        head.next.next = new ListNode(1);
//        head = deleteMultipleOf3(head);
//        while (head!=null){
//            System.out.println("head.val = " + head.val);
//            head = head.next;
//        }
    }
    public static ListNode deleteMultipleOf3 (ListNode head) {
        // write code here
        ListNode pre = new ListNode(-1);
        pre.next = head;
        ListNode next = pre;
        while (head!=null){
            if(head.val%3 == 0){
                pre.next = head.next;
                head = head.next;
                System.out.println("pre = " + pre);
            }else {
                pre = head;
                head = head.next;
            }
        }
        return next.next;
    }

    private static int getLength(String str, int k) {
//        int length = 0;
////        String rep = new String(str);
////        for(int len  = 0;len < k;len++) {
////            String res = "";
////            for (int i = 0; i < rep.length(); i++) {
////                res += rep.charAt(i);
////                if (rep.charAt(i) >= 'A' && rep.charAt(i) <= 'Z') {
////                    res += rep.charAt(i);
////                }
////            }
////            System.out.println("res = " + res);
////            rep = new String(res);
////            length = Math.max(res.length(),length);
////        }
////        return length;
        int length=0; int small = 0;int bigL= 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i)>='A'&&str.charAt(i)<='Z'){
                bigL++;
            }else small++;
        }
        System.out.println("bigL = " + bigL);
        System.out.println("small = " + small);
        int x = (int) Math.pow(2,k);
        System.out.println("x = " + x);
        return bigL*x+small;
    }
}
